//package com.hmdp.config;
//
//
//import com.hmdp.inceptor.JwtInterceptor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
//@Configuration
//@Slf4j
//public class WebConfig implements WebMvcConfigurer {
//
//    @Autowired
//    private JwtInterceptor jwtInterceptor;
//
//
//    public void addInterceptors(InterceptorRegistry registry) {
//        log.info("开始注册自定义拦截器...");
//        registry.addInterceptor(jwtInterceptor)
//                .addPathPatterns("/*/**")  // 拦截所有路径
//                .excludePathPatterns("/user/login")
//                .excludePathPatterns("/user/code")
//                .excludePathPatterns("/shop/**")
//                .excludePathPatterns("/shop-type/**")
//                .excludePathPatterns("/blog/hot")
//                .excludePathPatterns("/voucher/list/**");// 排除登录路径
//    }
//}